//
//  KABHpUserWallCCell.m
//  kabu
//
//  Created by XiangDongMBP on 2017/2/15.
//  Copyright © 2017年 East. All rights reserved.
//

#import "KABHpUserWallCCell.h"
#import "GlobalHeader.h"
#import "KABModel.h"
#import <YYWebImage.h>

@implementation KABHpUserWallCCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)configViewWithUserItem:(KABMineUserItem *)item {
    [self.portraitImgView yy_setImageWithURL:[NSURL URLWithString:item.headimg_url]
                                 placeholder:[KABDefaultVarModel sharedInstance].smallDefaultImg];
    self.nameLabel.text = item.nick_name;
    self.totalLabel.hidden = YES;
}

@end


@implementation KABHpUserWallCCell (SkinRelative)
- (void)configViewWithSkinClassItem:(KABSkinClassItem *)item index:(NSInteger)index totalCnt:(NSInteger)totalCnt {
    [self.portraitImgView yy_setImageWithURL:[NSURL URLWithString:item.cover_img_url]
                                 placeholder:[KABDefaultVarModel sharedInstance].smallDefaultImg];
    self.nameLabel.text = item.name;
    self.totalLabel.text = [NSString stringWithFormat:@"全部(%zd)", totalCnt];
    if (index == 5) {
        self.nameLabel.hidden = (totalCnt > 6);
        self.totalLabel.hidden = (totalCnt <= 6);
    } else {
        self.nameLabel.hidden = NO;
        self.totalLabel.hidden = YES;
    }
}

@end
